﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace ProjetIntegrationMobilite
{
    public class BoardResponse
    {
        [XmlArrayItem("board")]
        public List<CompactBoardModel> boards = new List<CompactBoardModel>();

        public class CompactBoardModel
        {
            public stringValue name = new stringValue();
            public dateValue creation_date = new dateValue();
            public stringValue owner = new stringValue();
            public stringValue invitee = new stringValue();
            public stringValue status = new stringValue();
            public stringValue size = new stringValue();
            public boolValue owner_while = new boolValue();

            [XmlArrayItem("move")]
            public List<Moves> moves = new List<Moves>();

            public CompactBoardModel() { }
            public CompactBoardModel(Board u)
            {
                this.creation_date.value = u.creation_date;
                this.name.value = u.Name;
                this.owner.value = u.owner;
                this.status.value = u.status;
                this.size.value = u.Size;
                this.owner_while.value = u.owner_white;
                this.invitee.value = u.invite;
                this.moves = u.listMove;
            }
        }
        public class stringValue
        {
            [XmlAttribute]
            public string value;
        }
        public class dateValue
        {
            [XmlAttribute]
            public DateTime value;
        }
        public class boolValue
        {
            [XmlAttribute]
            public bool value;
        }
    }
}
